home *** CD-ROM | disk | FTP | other *** search
-
- Amazing isn't? How you can write something and then later take a
- look at it and the foolishness is no very obvious...
-
- In my previous reply to the collision-detection I made a rather
- stupid design, resulting in the collision-detection being MUCH
- slower than it should be, not quite sure what happened there,
- sorry. :)
-
- Anyway, the new design is:
-
- For OBJECT1=0 To 10
- If Bob Col(OBJECT1, OBJECT1+1 To 11)
- For OBJECT2=OBJECT1+1 To 11
- If Col(OBJECT2)
- Rem Objects OBJECT1 and OBJECT2 have collided, so
- Rem do your collision-processing here...
- End If
- Next OBJECT2
- End If
- Next OBJECT1
-
- Now, THAT IS AN OPTIMIZED DESIGN!!!!
-
- The advantages over the first one:
-
- 1. The MAIN advantage is that each collision between any two
- objects is only performed once so we only need a total of 66
- Col checks, AND these Col checks are only performed if
- AMOS has detected a collison, so it should be VERY FAST.
- 2. The actual loop-processing is very tiny which means it will be
- quite fast.
- 3. We're no longer utilizing an external Procedure call, which also
- makes this version a bit faster.
-
- Finally, the whole thing is highly stream-lined and is the essence of
- creating an optimized design!!
-
- If this doesn't speed up your game then the problem MUST be
- something other than the collision-detection...
-
- Let me know what the new frame-rate is!!
-
-
- Take care,
- GARFIELD
- _________________________
- Current projects...
- SideShooter(AMOS): 85% Complete
- Website(http://www.sosbbs.com/~gbenjam): 20% Complete
-
-